/******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
* File Name          : stm32f10x_encoder.h
* Author             : IMS Systems Lab
* Date First Issued  : 21/11/07
* Description        : This file contains the software implementation for the
*                      encoder position and speed reading.
********************************************************************************
* History:
* 21/11/07 v1.0
********************************************************************************
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __Y_ENCODER_H
#define __Y_ENCODER_H

#define Y_ENCODER_TIMER   TIM4  // Encoder unit connected to TIM3
#define Y_ICx_FILTER      (u8)3 // 6<-> 670nsec
#define Y_Dir             Y_ENCODER_TIMER->CR1 & TIM_CounterMode_Down

/* Exported functions ------------------------------------------------------- */
extern volatile int Y_Dev;
extern volatile int m_CurrPos[2];
void Y_ENC_Init(void);
void TIM4_IRQHandler(void);
void Y_ENC_SetCounter(int Total_Couner);
int Y_ENC_Get_Counter(void);
void Y_ENC_SetPeriod(unsigned int period);
#endif  /*__STM32F10x_ENCODER_H*/
/******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/
